home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Shareware / IDimager Personal 4.2.0.3 / setup_IDimager_Personal_V4.exe / {app} / web / modules / frontpage.psc < prev    next >
Text File  |  2008-06-22  |  3KB  |  85 lines

  1. <!-- optionally enter text for the home page here -->
  2.  
  3.  
  4. %code
  5.  
  6. %include storeddata.inc %/include
  7. %include resulttable.inc %/include
  8.  
  9.   function LastUsedProps: WideString;
  10.   const
  11.     cCount = 50;
  12.   var
  13.     AProps: TCatalogItemProps;
  14.     ADs: TDBXOMClientDataSet;
  15.     i: Integer;
  16.   begin
  17.     result := toWideString('');
  18.  
  19.     result := result + '<div id="lastlabels">';
  20.  
  21.     result := result + '<div id="caption">';
  22.     result := result + '   Last used catalog labels';
  23.     result := result + '</div>';
  24.  
  25.     AProps := TCatalogItemProps.Create(TCatalogItemProp, '');
  26.     ADs := catalog.NewDataSet;
  27.  
  28.     if Catalog.IsSqlServer then
  29.       ADs.CommandText := 'select top ' + IntToStr(cCount) +' * from idProp where Propvalue <> ''A'' order by idCreated desc'
  30.     else
  31.       ADs.CommandText := 'select * from idProp where Propvalue <> ''A'' order by idCreated desc limit ' + IntToStr(cCount) + '';
  32.  
  33.     ADs.Open;
  34.     AProps.AddDataSet (ADs);
  35.     ADs.Close;
  36.     ADs.Free;
  37.  
  38.     Catalog.PathNameForProps (AProps, ' :: ', False);
  39.  
  40.     Randomize;
  41.  
  42.     for i := 0 to AProps.Count - 1 do
  43.     begin
  44.       result := result + '<span style="font-size: ' + IntToStr(RandomNumber(8) + 8) + 'pt;">';
  45.       result := result + iif(i = 0, '', ', ') + '<a href="javascript:getHTML(''%var:PageOffset/modules/labelimages.psc'', ''' + AjaxContainer + ''', ''GUID=' + AProps.Items[i].GUID + ''');" title="' + Aprops.Items[i].Name + '" style="color: ' + iif(i mod 2 = 0, '#0066a0; font-weight:bold', '') + ';">' + AProps.Items[i].PropName + '</a>';
  46.       result := result + '</span>';
  47.     end;
  48.  
  49.     AProps.Free;
  50.  
  51.     result := result + '</div>';
  52.  
  53.   end;
  54.  
  55.   function LastComments;
  56.   var
  57.     AItems: TCatalogItems;
  58.   begin
  59.     result := toWideString('');
  60.  
  61.     if not FindStoredData ('dsLASTCOMMENTS', AItems, False) then
  62.     begin
  63.       AItems := TCatalogItems.Create (TCatalogItem, '');
  64.       StoreData ('dsLASTCOMMENTS', AItems);
  65.     end;
  66.  
  67.     AItems.Clear;
  68.     if Catalog.EnumCommentedItems (AItems, 14) then
  69.     begin
  70.       AItems.Name := IntToStr(AItems.Count) + ' Last Commented Images';
  71.  
  72.       result := result + '<div id="lastLabels">';
  73.       result := result + IncludeResultTable (AItems, 'dsLASTCOMMENTS', 1, AItems.Count, 80);
  74.       result := result + '</div>';
  75.     end;
  76.   end;
  77.  
  78. begin
  79.   result := toWideString('');
  80.  
  81.   result := result + '<p>' + LastComments + '</p>';
  82.   result := result + '<p>' + LastUsedProps + '</p>';
  83. end;
  84.  
  85. %/code